package com.lovi.collection_.set_;

/**
 * 自己模拟一下hashset的底层hashmap的
 * 数组+链表结构
 */
public class HashSetStruct {
    public static void main(String[] args) {
        Node[] table = new Node[16];
        Node john = new Node("john");
        table[2] = john;
        Node jack = new Node("jack");
        john.next = jack;
        Node rose = new Node("Rose");
        jack.next = rose;
        Node lucy = new Node("lucy");
        table[3] = lucy;
        System.out.println(table);
    }
}
class Node{
    Object item;
    Node next;
    public Node(Object item) {
        this.item = item;
    }
    public Node(Object item, Node next) {
        this.item = item;
        this.next = next;
    }
}

